
open Printf
let count = ref 0

let while_run1 () = 
  (* contains both *)
  while (!count < 10) do 
    printf "%d\n%!" !count;
    incr count;
    if !count == 5 then continue;
    if !count >= 5 then break;   
  done;;

let while_run2 () = 
  (* contains continue, not break *)
  while (!count < 10) do
    printf "%d\n%!" !count;
    incr count;
    if !count == 5 then continue;
  done;;

let while_run3 () = 
  (* contains break, not continue *)
  while (!count < 10) do
    printf "%d\n%!" !count;
    incr count;
    if !count == 5 then break;
  done;;

let while_run4 () = 
  (* contains neither--should compile unchanged. *)
  while (!count < 10) do
    printf "%d\n%!" !count;
    incr count;
  done;;


let for_run1 () = 
  (* both are present *)
  for count = 10 downto 1 do 
    if count == 9 then continue;
    printf "%d\n%!" count;
    if count < 6 then break;
  done;;

let for_run2 () = 
  (* contains break, not continue *)
  for count = 1 to 10 do 
    printf "%d\n%!" count;
    if count < 6 then break;
  done;;

let for_run3 () = 
  (* contains continue not break *)
  for count = 10 downto 1 do 
    if count == 9 then continue;
    printf "%d\n%!" count;

  done;;

let for_run4 () = 
  (*  neither are present *)
  for count = 10 downto 1 do 
    printf "%d\n%!" count;

  done;;


printf "while tests\n";;

while_run1();;
while_run2();;
while_run3();;
while_run4();;

printf "for tests\n";;

for_run1();;
for_run2();;
for_run3();;
for_run4();;


(* either of the 2 lines below cause an parse error. *)

(*
continue;;
break;;

*)
